package com.luojing.springcloud.Filter;/**
 * Created by luojing on 2017/6/6.
 */

import com.netflix.zuul.ZuulFilter;
import com.netflix.zuul.context.RequestContext;

import javax.servlet.http.HttpServletRequest;

/**
 * @author
 * @create 2017-06-06 14:32
 **/
public class AccessFilter extends ZuulFilter {


    /**
     *
     pre：可以在请求被路由之前调用
     routing：在路由请求时候被调用
     post：在routing和error过滤器之后被调用
     error：处理请求时发生错误时被调用
     * @return
     */
    @Override
    public String filterType() {
        return "pre";
    }

    @Override
    public int filterOrder() {
        return 0;
    }

    @Override
    public boolean shouldFilter() {
        return false;
    }

    @Override
    public Object run() {
        RequestContext ctx = RequestContext.getCurrentContext();
        HttpServletRequest request = ctx.getRequest();


        return null;
    }
}
